package com.maxd.respository.helpTask;

import com.maxd.model.HelpUserScore;
import com.maxd.model.HelpUserScoreDetails;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.Repository;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface HelpUserScoreDetailsRepository extends Repository<HelpUserScoreDetails, Long> {

    @Query(value = "select * from help_user_score_details d where d.user_id=:userId order by create_time desc",
            countQuery="select count(*) from help_user_score_details d where d.user_id=:userId"
            ,nativeQuery = true)
    List<HelpUserScoreDetails> selectHelpUserScoreDetailsList(@Param("userId") Long userId, Pageable pageable);

}
